<?php namespace App\Models\Cxhshop;

use App\Models\Base\CxhshopBase;
use Illuminate\Support\Facades\DB;
class Cartype extends CxhshopBase {
    protected $table = 'ims_cxh_cartype';
    /**
     * 根据类型来获取车型：1app首页需要的车型；2车辆补贴需要的车型
     * @param int $form
     * @return array
     */
    public function getCarTypeByForm($form=2){
        $list = self::query() -> where('form',$form) ->get(['id','type as name']);
        if($list){
            $data = $list -> toArray();
        }else{
            $data = [];
        }
        return $data;
    }
   

}